package com.bishe.demo.modules.tourism.dao;

import com.bishe.demo.modules.tourism.entity.Process;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description ProcessDao
 * @Author Lubb
 * @Date 2021/4/1 13:36
 */
@Repository
@Mapper
public interface ProcessDao {

    @Select("select * from tourism_process where fk_route_id = #{routeId}")
    List<Process> getProcessesByRouteId(Integer routeId);

    @Insert("insert into tourism_process(day,process,detail,fk_route_id) values(#{day},#{process}," +
            "#{detail},#{fk_route_id})")
    void addProcess(Process process);

    @Delete("delete from tourism_process where fk_route_id = #{routeId}")
    void deleteProcessByRouteId(Integer routeId);
}
